package com.audaque.springboot.foshanupload.web.datajpademo.model.entity;

import com.audaque.springboot.foshanupload.jpa.base.entity.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Data

@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "t_type")
public class Type extends BaseEntity {


    @NotBlank(message = "分类名称不能为空")
    private String name;

    @OneToMany(mappedBy = "type")
    private List<com.audaque.springboot.foshanupload.web.datajpademo.model.entity.Blog> blogs = new ArrayList<>();

}
